<template>
  <div class="container">
   <h1>父组件</h1>
   {{ money }}
   <h1>子组件</h1>
   <!-- <son :money="money" @change-money="changMoney"></son> -->
   <son v-model:money="money" ></son>
  </div>
</template>

<script>
import { ref } from "vue";
import son from './son.vue'

export default {
  components: { son },
  name: "App",

  setup() {
   // 组件被创建之前 
   //写数据 写方法  写生命周期   
   const money =ref(100) 
   const  changMoney=(value)=>{
     money.value=value
   } 
    return {money,changMoney };
  },
};
</script>

<style>
</style>